package
{
	import com.core.Game;
	
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.MouseEvent;
	import flash.text.TextField;

	public class GameTest extends Game
	{
		private var count:int = 0;
		private var level:int = 0;
		
		private var bg:Sprite = new Sprite;
		private var txt:TextField = new TextField;
		
		public function GameTest()
		{
			super();
			init();
		}
		override public function newGame():void{
			
		}
		override public function newLevel():void{
			level++;
		}
		override public function runGame():void{
			txt.text = level.toString();
			this.addEventListener(MouseEvent.CLICK,onClick);
		}
		private function init():void{
			addChild(bg);
			addChild(txt);
			
			
			bg.graphics.beginFill(0xff0000);
			bg.graphics.drawRect(0,0,550,400);
			bg.graphics.endFill();
		}
		private function onClick(e:MouseEvent):void{
			dispatchEvent(new Event("new_level"))
		}
	}
}